#include "zipbookdatabuilder.h"

ZIPBookDataBuilder::ZIPBookDataBuilder(const QString &fileName):BookDataBuilder(fileName)
{
}
void ZIPBookDataBuilder::parse()
{
    QString exePath = QCoreApplication::applicationDirPath ();
    QFileInfo fileInfo(_fileName);
    QDir qdir;
    qdir.setCurrent(exePath+"\\cache");
    QString newDirName = fileInfo.fileName().left(fileInfo.fileName().length()-4);
    if(!qdir.exists(newDirName)){
        qdir.mkdir(newDirName);
    }
    QZip zip(this->_fileName,exePath+"\\cache\\"+newDirName);
    zip.unzip();
}
